// task模块的小仓库
import {reqNeuTask, reqTankHistory ,reqIdTack} from "@/api"; //引入api里面的axios
const state = {
    tankHistory:[],
    idTask: {}
};
const mutations = {
    GETTANKHISTORY(state,tankHistory){
        state.tankHistory = tankHistory
    },
    GETIDTACK(state,idTask){
        state.idTask= idTask
    }
};
const actions = {
    // eslint-disable-next-line no-unused-vars
    async getNeuTask({commit}, neuTask) {
        let result = await reqNeuTask(neuTask);

        // console.log(result);
        if (result.code == 200) {
            return result
        }
    },

    // eslint-disable-next-line no-unused-vars
    async getTankHistory({commit}, neuTask) {
        let result = await reqTankHistory(neuTask);

        // console.log(result);
        if (result.code == 200) {
            commit("GETTANKHISTORY", result.data);
            return result
        }
    },

    // eslint-disable-next-line no-unused-vars
    async getIdTack({commit}, id) {
        let result = await reqIdTack(id);

        // console.log(result);
        if (result.code == 200) {
            commit("GETIDTACK", result.data);
            return result
        }
    },

};
const getters = {};
export default {
    namespaced: true,
    state,
    mutations,
    actions,
    getters,
};